package com.jvtd.nettyim.im.codec;

import com.jvtd.nettyim.im.protocol.PacketCode;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;

import java.util.List;

/**
 * @author Created by neal.zhang
 * @date 2020/5/29 - 18:15
 */
public class PacketDecoder extends ByteToMessageDecoder {
    @Override
    protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
        out.add(PacketCode.INSTANCE.decode(in));
    }
}
